package com.sskj.jd.domain.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.BatchSize;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sskj.core.entity.BaseEntity;

@Table(name = "JD_FoundWT")
@Entity
public class FoundWT extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@JsonIgnore
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
	@JoinColumn(name = "jdjlId", nullable = true)
	private JianDuJiLu jdjl;

	// 问题类型文字
	private String lxms = "";

	// 问题
	private String wt = "";

	// 问题描述
	private String wtms = "";

	// 排序
	private Integer sort = 1;

	// 图片
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "wt", orphanRemoval = true)
	@BatchSize(size = 50)
	@OrderBy("sort")
	private List<WenTiIMG> images = new ArrayList<WenTiIMG>();

	// 文件
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "wt", orphanRemoval = true)
	@BatchSize(size = 50)
	@OrderBy("sort")
	private List<WenTiFILE> files = new ArrayList<WenTiFILE>();

	// 问题类型
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "wt", orphanRemoval = true)
	@BatchSize(size = 50)
	@OrderBy("value")
	private List<WenTiLX> wtlx = new ArrayList<WenTiLX>();

	@JSONField(serialize = false)
	public JianDuJiLu getJdjl() {
		return jdjl;
	}

	public void setJdjl(JianDuJiLu jdjl) {
		this.jdjl = jdjl;
	}

	/**
	 * @return the wtms
	 */
	public String getWtms() {
		return wtms;
	}

	/**
	 * @return the images
	 */
	public List<WenTiIMG> getImages() {
		return images;
	}

	/**
	 * @return the files
	 */
	public List<WenTiFILE> getFiles() {
		return files;
	}

	/**
	 * @return the wtlx
	 */
	public List<WenTiLX> getWtlx() {
		return wtlx;
	}

	/**
	 * @param wtms
	 *            the wtms to set
	 */
	public void setWtms(String wtms) {
		this.wtms = wtms;
	}

	/**
	 * @param images
	 *            the images to set
	 */
	public void setImages(List<WenTiIMG> images) {
		this.images = images;
	}

	/**
	 * @param files
	 *            the files to set
	 */
	public void setFiles(List<WenTiFILE> files) {
		this.files = files;
	}

	/**
	 * @param wtlx
	 *            the wtlx to set
	 */
	public void setWtlx(List<WenTiLX> wtlx) {
		this.wtlx = wtlx;
	}

	/**
	 * @return the lxms
	 */
	public String getLxms() {
		return lxms;
	}

	/**
	 * @param lxms
	 *            the lxms to set
	 */
	public void setLxms(String lxms) {
		this.lxms = lxms;
	}

	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}

	public String getWt() {
		return wt;
	}

	public void setWt(String wt) {
		this.wt = wt;
	}

}
